package com.zc.study.designPattern.结构型设计模式.adapterPattern;

public class Test {
    public static void main(String[] args) {
        ScoreOperation operation;//针对抽象目标的接口编程
        operation = new OperationAdapter();
        int scores[] = {84, 76, 50, 69, 90, 91, 88, 96};//定义成绩数组
        int result[];
        int score;
        System.out.println("成绩排序结果: ");
        result = operation.sort(scores);

        //遍历输出成绩
        for (int i : result) {
            System.out.println(i + ",");
        }
        System.out.println("查找成绩90:");
        score = operation.search(result, 90);
        if (score != -1) {
            System.out.println("找到成绩90.");
        } else {
            System.out.println("没有找到成绩90.");
        }

    }
}
